const path=require('path');

module.exports={
    mode:'development',
    entry:'./src/index.js',
    output:{
        path:path.resolve(__dirname,'dist'),
        filename:'bundle.js'
    },
    module:{
        rules:[
            {
                test:/\.scss$/,
                use: [{
                    loader:"style-loader" //create style nodes from JS strings
                },{
                    loader:"css-loader"//transiates CSS into CommonJS
                },{
                    loader:"sass-loader" //compiles Sass to CSS
                }
                ]
            },
            {
                test:/\.js$/,
                use:'babel-loader'
            }
        ]
    },
    devServer:{
        contentBase: './dist',
        watchContentBase:true
    }
};